/**
 * 用户信息接口
 */
export interface UserInfo {
  userId: number
  userName: string
  nickName: string
  email: string
  phonenumber: string
  sex: string
  avatar: string
  status: string
  delFlag: string
  loginIp: string
  loginDate: string
  createBy: string
  createTime: string
  updateBy: string
  updateTime: string
  remark: string
  deptId: number
  deptName: string
  roleIds: number[]
  roles: Role[]
}

/**
 * 角色信息接口
 */
export interface Role {
  roleId: number
  roleName: string
  roleKey: string
  roleSort: number
  dataScope: string
  menuCheckStrictly: boolean
  deptCheckStrictly: boolean
  status: string
  delFlag: string
  createBy: string
  createTime: string
  updateBy: string
  updateTime: string
  remark: string
  flag: boolean
  menuIds: number[]
  deptIds: number[]
  permissions: string[]
}

/**
 * 登录表单接口
 */
export interface LoginForm {
  username: string
  password: string
  code?: string
  uuid?: string
  rememberMe?: boolean
}

/**
 * 登录响应接口 - 匹配后端SysLoginController
 */
export interface LoginResponse {
  token: string // 匹配后端Constants.TOKEN字段
}

/**
 * 用户信息响应接口
 */
export interface UserInfoResponse {
  user: UserInfo
  roles: string[]
  permissions: string[]
}

/**
 * 验证码响应接口 - 匹配后端/auth/captcha接口
 */
export interface CaptchaResponse {
  uuid: string
  img: string
  captchaEnabled: boolean
}

/**
 * 修改密码表单接口
 */
export interface ChangePasswordForm {
  oldPassword: string
  newPassword: string
  confirmPassword: string
}

/**
 * 修改个人信息表单接口
 */
export interface UpdateProfileForm {
  nickName: string
  email: string
  phonenumber: string
  sex: string
}

/**
 * 用户查询参数接口
 */
export interface UserQuery {
  pageNum?: number
  pageSize?: number
  userName?: string
  phonenumber?: string
  status?: string
  deptId?: number
  beginTime?: string
  endTime?: string
  orderByColumn?: string
  isAsc?: string
}
